package com.bitdf.txing.chat.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bitdf.txing.common.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * 
 * @author ???
 * @email 123@qq.com
 * @date 2022-11-23 22:43:49
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tx_cms_chat_message")
public class ChatMessageEntity extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 发送者id
	 */
	private Long fromUserId;
//	private String fromUserId;
	/**
	 * 接受者/群聊id
	 */
	private Long toTargetId;
//	private String toTargetId;
	/**
	 * 信息内容
	 */
	private String content;
	/**
	 * 发送时间
	 */
	private Date createTime;
	/**
	 * 类型 0: 私聊 1：群聊
	 */
	private Byte type;
//	private String type;
	/**
	 * 信息类型（0：文本 1：图片 2：视频 3：加团申请）
	 */
	private Integer contentType;
	/**
	 * 时间戳
	 */
	@TableField(exist = false)
	private Long timestamp;


	public Long getTimestamp() {
		return this.createTime.getTime();
	}
}
